package com.laijiale.entity;

import com.mybatisflex.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *  实体类。
 *
 * @author laijiale
 * @since 2024-12-22
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "role_menu", schema = "ml_ums")
public class RoleMenu implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 角色ID
     */
    private Long fkRoleId;

    /**
     * 菜单ID
     */
    private Long fkMenuId;

    /**
     * 数据版本
     */
    @Column(version = true)
    private Long version;

    /**
     * 逻辑删除
     */
    @Column(isLogicDelete = true)
    private Integer deleted;

    /**
     * 创建时间
     */
    private LocalDateTime created;

    /**
     * 修改时间
     */
    private LocalDateTime updated;
    /**中间表[1]：角色[1]*/
    @RelationOneToOne(selfField = "fkRoleId", targetField = "id")
    private Role role;
    @RelationOneToOne(selfField = "fkMenuId", targetField = "id")
    private Menu menu;


}
